/**
 * yiqihao(一起好商务股份有限公司) copyright 
 */
package com.p2p.front.service.impl;

import javax.annotation.Resource;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import com.p2p.front.dal.dao.IpInfoDao;
import com.p2p.front.dal.model.IpInfo;
import com.p2p.front.service.IpInfoService;

/**
 *
 * @author leiruiqi@yiqihao.com
 *
 * 2015年2月12日 上午9:18:05
 */
@Service("ipInfoService")
public class IpInfoServiceImpl implements IpInfoService{

	@Resource
	private IpInfoDao ipInfoDao;
	
	@Override
	public String getZoneByIpStr(String ipStr) {
		IpInfo ipInfo = getByIpStr(ipStr);	
		
		if(ipInfo!=null&&StringUtils.isNotBlank(ipInfo.getZone())){
			return ipInfo.getZone();
		}
		return null;
	}

	@Override
	public IpInfo getByIpStr(String ipStr) {
		return ipInfoDao.getByIpStr(ipStr);
	}

}
